<?php
/**
 * @name IndexController
 * @author 6p2b7gaqkyoe4aw\administrator
 * @desc 默认控制器
 * @see http://www.php.net/manual/en/class.yaf-controller-abstract.php
 */
class IndexController extends Yaf_Controller_Abstract {

	public function init(){
		//$this->_layout = Yaf_Registry::get('layout');
	}
	
	public function getconfigAction(){
		
		//读取配置文件
		$config = Yaf_Application::app()->getConfig();
		echo $config['database']['params']['prefix'];exit;
		//打印配置信息
		echo '<pre>';
		print_r($config);
		echo '</pre>';
	}
	
	public function actionAction(){
		//print_r($_REQUEST);
	}
	
	/** 
     * 默认动作
     * Yaf支持直接把Yaf_Request_Abstract::getParam()得到的同名参数作为Action的形参
     * 对于如下的例子, 当访问http://yourhost/qungbang/index/index/index/name/6p2b7gaqkyoe4aw\administrator 的时候, 你就会发现不同
     */
	public function indexAction($name = "Stranger") {
		//1. fetch query
// 		$get = $this->getRequest()->getQuery("get", "default value");
      
// 		//2. fetch model
// 		$model = new SampleModel();

// 		//3. assign
// 		$this->getView()->assign("content", $model->selectSample());
// 		$this->getView()->assign("name", $name);

// 		//4. render by Yaf, 如果这里返回FALSE, Yaf将不会调用自动视图引擎Render模板
//         return TRUE;
		
		//$this->getView()->display('../../theme/default2/dist/index.html');
		$this->getView()->display('index/default2.phtml');
		
		//$this->_layout->meta_title = '前台首页';
	}
	
    
	
}
